<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'index.jsp' starting page</title>
   		<link href="css/table.css" type="text/css" rel="stylesheet" />
		<script language="javascript" src="js/table.js"></script>
		<style type="text/css">
table {
	border: 1px solid black;
	border-collapse: collapse;
}

table thead tr th {
	border: 1px solid black;
	padding: 3px;
	background-color: #cccccc;
}

table tbody tr td {
	border: 1px solid black;
	padding: 3px;
}
</style>
	</head>
	<body>
	<h5 type="float:right"><a href="/Struts2new/admin/out.action">退出登录</a></h5>
		<center>
			<h2>
				<font color="green">欢迎管理员<s:property value="admin.aname" />登陆！</font>
			</h2>
			<h3>
				<a href="/Struts2new/admin/addManager.jsp">添加管理员</a>
			</h3>
			<h3>
				<a href="/Struts2new/admin/alist.action">删除管理员</a>
			</h3>
			<h3>
				<a href="/Struts2new/admin/addnews.jsp">添加新闻</a>
			</h3>
			<h3>
				<a href="/Struts2new/index.jsp">返回首页</a>
			</h3>
		</center>
		<center>
		<table border="1" id="senfe">
			<thead>
				<tr>
					<th>
						编号
					</th>
					<th>
						标题
					</th>
					<th>
						作者
					</th>
					<th>
						日期
					</th>
					<th>
						操作
					</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="Newss">
					<tr>
						<td>
							<s:property value="id" />
						</td>
						<td>
							<s:property value="title" />
						</td>
						<td>
							<s:property value="name" />
						</td>
						<td>
							<s:property value="date" />
						</td>
						<td>
							<a
								href='<s:url action="edit"><s:param name="id" value="id" /></s:url>'>
								修改 </a> &nbsp;
							<a
								href='<s:url action="delete"><s:param name="id" value="id" /></s:url>'>
								删除 </a>
				</td>
					</tr>
				</s:iterator>
			</tbody>
			<script language="javascript">
			//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
				senfe("senfe","#fff","#ccc","#cfc","#f00");
			</script>
		</table>
		<br>
		</center>
		<center>
		共<s:property value="intRowCount"/>记录&nbsp;&nbsp;
		第<s:property value="pageNow"/>页&nbsp;&nbsp;
		 <s:url id="url_pre" value="list2.action">   
         <s:param name="pageNow" value="pageNow-1"></s:param>   
     </s:url>   
  
     <s:url id="url_next" value="list2.action">   
         <s:param name="pageNow" value="pageNow+1"></s:param>   
     </s:url>   
     <s:iterator value="Newss" status="status">   
        <s:url id="url" value="list2.action">   
            <s:param name="pageNow" value="pageNow"/>   
        </s:url>   
     </s:iterator>    
     <s:if test="pageNow==1">
	<s:a href="%{url_pre}">最前一页</s:a>
     </s:if>
     <s:else>
     <s:a href="%{url_pre}">上一页</s:a>
     </s:else>
     <s:if test="pageNow==k">
     <s:a href="%{url_next}">最后一页</s:a>
  	 </s:if>
  	 <s:else>
  	 <s:a href="%{url_next}">下一页</s:a>
  	 </s:else>
  	 </center>
	</body>
</html>